from django.urls import path
from .views import ShopsView, ShopsViewSer
from .views import GoodsTypeView,GoodsView

urlpatterns = [
    # # 入驻申请
    path('register/', ShopsView.as_view({"post": "shops_register"})),

    # 获取商家用户信息
    path('userinfo/', ShopsView.as_view({"get": "shops_dict", "put": "up_user"})),

    # 获取所有商家信息
    path('shopsinfo/', ShopsViewSer.as_view({"get": "shops_list"})),

    # 反查询 查询店家下的分类 分类下的商品详情
    path('shopslist/<int:pk>', ShopsView.as_view({"get": "shops_list"})),

    # 商品类别
    path('goods_type/', GoodsTypeView.as_view({"get": "list", "post": "add", "put": "update"})),

    # 删除、查找单个商品分类
    path('goods_type/<int:pk>', GoodsTypeView.as_view({"delete": "delete", "get": "good_get"})),

    # 商品
    path('goods/', GoodsView.as_view({"get": "list", "post": "add", "put": "update"})),

    # 删除、查找单个商品
    path('goods/<int:pk>', GoodsView.as_view({"delete": "delete",  "get": "good"})),

    # 反查询
    path('good/<int:pk>', GoodsView.as_view({"get": "good_get"}))

]




